<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>
        <span class="x"></span>
    </h1>
    <h1>
        <span class="y"></span>
    </h1>
    <h1>
        <span class="x1"></span>
    </h1>
    <h1>
        <span class="y1"></span>
    </h1>
    <script>
        document.onclick = function(e){
            var event = e || window.event;
            document.querySelector(".x").innerHTML = event.clientX;
            document.querySelector(".y").innerHTML = event.clientY;
        }
        document.onmousemove = function(e){
            var event = e || window.event;
            document.querySelector(".x1").innerHTML = event.clientX;
            document.querySelector(".y1").innerHTML = event.clientY;
        }
    </script>
</body>
</html>